import React from 'react';
import {NavLink} from 'react-router-dom';
import {connect} from 'react-redux';
import actions from '../../store/modules/user/actions';
import './index.scss';

class BookShelf extends React.Component {
  render() {
    return (
      <div className='page_bookshelf'>
        <div className="g-hd">
          <div className="log">多看阅读</div>
          <div className="act">
            <NavLink to="/">
              <div className="m-logout" >书城</div>
            </NavLink>
            <span className="bor1">|</span>
            <div className="m-logout" onClick={this.props.handleLogout} >退出</div>
            <span className="bor">|</span>
            <NavLink to="/search">
              <div className="m-search iconfont icon-sousuo" />
            </NavLink>
          </div>
        </div>
      </div>
    );
  }
};

export default connect(
  null,
  (dispatch,props) => {
    return {
      handleLogout: () => {
        dispatch(actions.LogoutAct(props));
      }
    }
  }
)(BookShelf);
